home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 001-100 / 001-025 / 019 / keymap_test / poster < prev    next >
Text File  |  1995-03-17  |  4KB  |  103 lines

  1. File: AMIGA.2570
  2. From: pk@pid.UUCP (Pushpa Kumar)
  3. Newsgroups: net.micro.amiga
  4. Subject: Bugs in key mapping
  5. Date: 24 Mar 86 12:54:18 GMT
  6. Organization: P & I Design, Inc. Atlanta
  7. Lines: 460
  8.  
  9.         There appears to be a bug in the keymapping routines when more than
  10. one qualifier is applied to a key.  I have setup a test program to illustrate
  11. this problem.
  12.  
  13.         In the test program keys 1, 2 ,3, & 4 only have been mapped.
  14. Key 4 + SHIFT is used to exit from the program.
  15.  
  16. The setup is as follows:
  17.  
  18. key   key type   qualifiers     expected code output      code actually output
  19. ---   --------   ----------     --------------------      --------------------
  20.  
  21. 1     0x05       NOQUAL         'a'                       'a'
  22.                  SHIFT          'b'                       'b'
  23.                  CTRL           'c'                       'b'
  24.                  CTRL + SHIFT   'd'                       'd'
  25.                                                         
  26. 2     0x43       NOQUAL         "2 + noqual"              "2 + noqual"
  27.                  SHIFT          "2 + shift"               "2 + shift" 
  28.                  ALT            "2 + alt"                 "2 + shift"
  29.                  SHIFT + ALT    "2 + shift + alt"         "t2 + a"
  30.  
  31. 3     0x47       NOQUAL         "3 + noqual"              "3 + noqual"
  32.                  SHIFT          "3 + shift"               "3 + shift"
  33.                  ALT            "3 + alt"                 "3 + shift"
  34.                  CTRL           "3 + ctrl"                "3 + shift"
  35.                  ALT + SHIFT    "3 + alt + shift"         "t3 + a"
  36.                  CTRL + ALT     "3 + ctrl + alt"          "t3 + a"
  37.                  CTRL + SHIFT   "3 + ctrl + shift"        "t3 + a"
  38.                  CTRL + ALT     "3 + ctrl + alt + shift"  "lt3 + c"
  39.                       + SHIFT
  40.  
  41. 4     0x01       NOQUAL         '4'                       '4'
  42.                  SHIFT          '$'                       '$'
  43.  
  44.  
  45.  
  46. I have several questions regarding the keymapping setup:
  47.  
  48. 1) Are the qualifiers for keytype 0x47 in the right order? It isn't very clear
  49.    what the order should be in the case when more than one qualifier is used.  
  50.    The ordering above for key 3 (keytype 0x47) is per table 4-7 of
  51.    the Console Device chapter in RKM vol 1.
  52.  
  53. 2) The Console Device chapter also refers to routines:
  54.             . GetKeyMap()
  55.             . SetKeyMap()
  56.  
  57.    Where are these documented?  I can't find any reference to them under
  58.    console.doc in RKM vol 2.  I did find CDAskKeyMap and CDSetKeyMap.
  59.    
  60.    Are the routines GetKeyMap() & SetKeyMap() in some special library?
  61.    I got linker error messages when I tried to use them.  So I had to use the
  62.    CD_ASKKEYMAP & CD_SETKEYMAP commands instead.
  63.  
  64. 3) The documentation says that " the high keytype table covers the raw    
  65.    keycodes from hex 40-67, and contains 38 (decimal) bytes".
  66.    Shouldn't that be 40 (decimal) bytes ?
  67.  
  68. 4) Also why doesn't Chk_Abort() work in this program ?
  69.  
  70. I hope you Amiga Experts out there can provide the answers and maybe a fix to
  71. the keymapping problem.  
  72.  
  73. There is also a bug in Lattice C that I might as well include in this article.
  74. I stumbled on it when dumping out the default Amiga keymap.
  75.  
  76.       UBYTE *p;
  77.       int    len, i;
  78.  
  79.       /* The expression on the RHS of the assignment statement below is
  80.        * evaluated correctly
  81.        */
  82.       len = *p + *(p+2) + 4;       
  83.  
  84.       /* The same expression when used in a "for" statement does not work 
  85.        */
  86.       for (i = 1; i <= (*p + *(p+2) +4); i++)
  87.         {
  88.         }
  89.  
  90.       /* But the statement below works fine
  91.        */
  92.       for (i = 1; i <= len; i++)
  93.         {
  94.         }
  95.  
  96.  
  97.  
  98. The keymapping test program follows in keymap_test.h and keymap_test.c
  99. -- 
  100. Pushpa Kumar 
  101. akgua!pid!pk
  102. 404/952-1572 (voice)
  103.